<template>
  <div class="rankMain">
    <div class="title">
      <span class="spanTitle"> {{ title }}</span>
      <div class="more">
        <span>更多</span>
        <img
          src="../../assets/images/comic/HomePage/title/index-title-more.png"
          alt=""
        />
      </div>
    </div>
    <ul>
      <li v-for="(item, index) in comicRankingList" :key="item.id">
        <div class="outsideDiv">
          <div class="img">
            <img :src="item.imgPath" alt="" />
          </div>
          <div class="sortNum">
            <span
              :class="[
                { first: index + 1 === 1 },
                { second: index + 1 === 2 },
                { third: index + 1 === 3 },
              ]"
              >{{ index + 1 }}</span
            >
          </div>
          <div class="info">
            <span class="name">{{ item.name }}</span
            ><br />
            <span class="content">{{ item.content }}</span>
          </div>
        </div>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  name: 'ranking',
  props: {
    comicRankingList: {
      type: Array
    },
    title: {
      type: String
    }

  },
  data () {
    return {
    };
  }
};
</script>
<style lang="less" scoped>
.rankMain {
  height: 100%;
  width: 380px;
  // background-color: hotpink;
  float: left;
}
.rankMain .title {
  height: 30px;
  display: flex;
  justify-content: space-between;
  .spanTitle {
    display: flex;
    align-items: center;
    display: block;
    height: 100%;
    font-size: 20px;
    font-weight: bold;
    float: left;
  }
  .more {
    height: 100%;
    float: left;
    display: flex;
    align-items: center;
    img {
      margin-left: 10px;
      position: relative;
      top: 2px;
    }
  }
}
.rankMain ul {
  li {
    margin-top: 3px;
    list-style: none;
    width: 100%;
    height: 58px;
    overflow: hidden;
    .outsideDiv {
      width: 100%;
      height: 100%;
      // background-color: aqua;
      display: flex;
      .img {
        float: left;
        height: 100%;
        img {
          height: 100%;
        }
      }
      .sortNum {
        float: left;
        height: 100%;
        width: 40px;
        display: flex;
        justify-content: center;
        span {
          display: block;
          height: 20px;
          width: 20px;
          border-radius: 100%;
          text-align: center;
          font-size: 15px;
          line-height: 20px;
          background-color: #f7f7f7;
          color: black;
        }
        .first {
          background-color: #feda00;
          color: #ffffff;
        }
        .second {
          background-color: #feaf00;
          color: #ffffff;
        }
        .third {
          background-color: #fe8f00;
          color: #ffffff;
        }
      }
      .info {
        flex: 1;
        //background-color: burlywood;
        .name {
          font-size: 15px;
          font-weight: bold;
        }
        .content {
          display: block;
          widows: 100%;
          text-overflow: ellipsis;
          overflow: hidden;
          white-space: nowrap;
          font-size: 14px;
          padding-left: 30px;
          margin-top: 10px;
        }
      }
    }
  }
}
</style>
